/*
 * MonomialProcedure.java
 *
 * Created on May 4, 2005, 7:27 PM
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package com.milowski.monos.scheme;

import gnu.mapping.*;
import com.milowski.monos.*;
import com.milowski.monos.monomial.*;

/**
 *
 * @author R. Alexander Milowski
 */
public class Symbol2MonomialProcedure extends Procedure2
{
   
   /** Creates a new instance of MonomialProcedure */
   public Symbol2MonomialProcedure()
   {
      super("symbol->monomial");
   }
   
   public Symbol2MonomialProcedure(String name)
   {
      super(name);
   }
   
   public Object apply2(Object obj1,Object obj2) {
      try {
         String exp = obj2.toString();
         return Monomial.toMonomial((LexOrder)obj1, exp);
      } catch (FormatException ex) {
         throw new RuntimeException(ex.getMessage());
      }
   }
   
}
